package com.dong.ioc.javabased;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * description
 *
 * @author Administrator 2021/09/06 10:10
 */
@Configuration
public class AppConfig {

    @Bean
    public User user(){
        return new User();
    }

    @Bean
    public String useUser(User user){
        System.out.println("注入的方式"+user.hashCode());
        System.out.println("调用的方式"+user().hashCode());
        return "Hello";
    }
}
